/* ----------------------------------------------------------------------------------------------------------------
 *  ReactionItem
 * ----------------------------------------------------------------------------------------------------------------
 */
package pure.engine.idea 
{
	/**
	 * 反应项目
	 * [Author] - Pure
	 * 
	 */
public class ReactionItem
{
	

	
	/**
	 * 调用反应器，执行反应
	 * 
	 * [Return] - 反应的持续时间
	 */
	public function execute(reactor:IReactor):Number
	{
		return 0;
	}

	
	/**
	 * 释放
	 */
	public function dispose():void
	{
		onStart = onEnd = null;
		onStartParams = onEndParams = null;
		prev = next = null;
	}
	
	
	/**
	 * 设置属性
	 */
	internal function setProperty(vars:Object):void
	{
		if (vars)
		{
			delay          =  Boolean(vars.delay) ? vars.delay : 0;
			onStart        =  vars.onStart;
			onStartParams  =  vars.onStartParams;
			onEnd          =  vars.onEnd;
			onEndParams    =  vars.onEndParams;
		}
	}
	
	

	internal var prev:ReactionItem, next:ReactionItem;

	internal var delay:Number = 0;  //  延迟时间，秒
	
	internal var onStart:Function, onEnd:Function;
	
	internal var onStartParams:Array, onEndParams:Array;
	
	
}

}